A good answer might be:

You should recognize this as one of the algorithms discussed in the previous chapter. The algorithm is now contained in a method but the idea (the algorithm) is the same, as seen in the code below:


Using an Array Parameter

Here is the completed program. The method is written using the parameter x to refer to the actual data that it will be supplied with. The method is written without referring to any particular data. The parameter x means "whatever data is supplied when the method starts to run." This might be different data at different times.

import java.io.*;

class ArrayOps
{
  void print( int[] x )
  {
    for ( int index=0; index < x.length; index++ )
      System.out.print( x[index] + " " );
    System.out.println();
  }
}

class ArrayDemo
{
  public static void main ( String[] args ) 
  {
    ArrayOps operate = new ArrayOps();
    int[] ar1 =  { -20, 19, 1, 5, -1, 27, 19, 5 } ;

    System.out.print  ("\nThe array is: " );
    operate.print( ar1 );
  }

}      

QUESTION 3:

What, exactly, does the parameter x hold when the print() method is running?